"""
导包
    获取数据地址
    使用工具打开
    获取sheet页
    获取横列最大值
    获取数列最大值


"""

import os
import xlrd
class readExcel():
    def __init__(self):
        self.path_name=os.path.dirname(os.path.dirname(__file__))+'/testdata/data.xls'
        self.open=xlrd.open_workbook(self.path_name)
        self.open1=self.open.sheet_by_index(0)
        self.max_row=self.open1.nrows
        self.max_clw=self.open1.ncols
        self.file=[]
        self.value1=self.open1.row_values(0)

    def run(self):
        for i in range(1,self.max_row):
            self.key=self.open1.row_values(i)
            dict1={self.value1[i]:self.key[i] for i in range(self.max_clw) }
            self.file.append(dict1)
        return self.file
if __name__ == '__main__':
    run=readExcel()
    print(run.run())
